Se muestra en este documento en primer lugar los contagios registrados por el Ministerio de Educación del Estado Plurinacional de Bolivia diarios y en una segunda sección los datos acumulados, todo esto por departamento.
Se encuentra en desarrollo un modelo para pronosticar los datos.
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
## Loading required package: ggplot2
##
## Attaching package: 'plotly'
## The following object is masked from 'package:ggplot2':
##
## last_plot
## The following object is masked from 'package:stats':
##
## filter
## The following object is masked from 'package:graphics':
##
## layout
botones=list(
list(
type="buttons",
buttons=list(
list(
label="Confirmados",
methos="update",
args=list("visible",list(T,F,F))
),
list(
label="Decesos",
methos="update",
args=list("visible",list(F,T,F))
),
list(
label="Recuperados",
methos="update",
args=list("visible",list(F,F,F))
)
)
)
)
nuevos=plot_ly(bn,type = "scatter",
x=~Fecha,y=~Confirmados,name="Beni",mode="lines+markers") %>%
# add_trace(y=~cb$Confirmados,name='Cochabamba',mode='lines+markers') %>%
# add_trace(y=~ch$Confirmados,name='Chuquisaca',mode='lines+markers') %>%
# add_trace(y=~lp$Confirmados,name='La Paz',mode='lines+markers') %>%
# add_trace(y=~or$Confirmados,name='Oruro',mode='lines+markers') %>%
# add_trace(y=~pn$Confirmados,name='Pando',mode='lines+markers') %>%
# add_trace(y=~pt$Confirmados,name='PotosÃ',mode='lines+markers') %>%
# add_trace(y=~sc$Confirmados,name='Santa Cruz',mode='lines+markers') %>%
# add_trace(y=~tj$Confirmados,name='Tarija',mode='lines+markers') %>%
add_trace(y=~bn$Decesos,name='Beni',mode='lines+markers',visible=F) %>%
# add_trace(y=~cb$Decesos,name='Cochabamba',mode='lines+markers') %>%
# add_trace(y=~ch$Decesos,name='Chuquisaca',mode='lines+markers') %>%
# add_trace(y=~lp$Decesos,name='La Paz',mode='lines+markers') %>%
# add_trace(y=~or$Decesos,name='Oruro',mode='lines+markers') %>%
# add_trace(y=~pn$Decesos,name='Pando',mode='lines+markers') %>%
# add_trace(y=~pt$Decesos,name='PotosÃ',mode='lines+markers') %>%
# add_trace(y=~sc$Decesos,name='Santa Cruz',mode='lines+markers') %>%
# add_trace(y=~tj$Decesos,name='Tarija',mode='lines+markers') %>%
add_trace(y=~bn$Recuperados,name='Beni',mode='lines+markers',visible=F) %>%
# add_trace(y=~cb$Recuperados,name='Cochabamba',mode='lines+markers') %>%
# add_trace(y=~ch$Recuperados,name='Chuquisaca',mode='lines+markers') %>%
# add_trace(y=~lp$Recuperados,name='La Paz',mode='lines+markers') %>%
# add_trace(y=~or$Recuperados,name='Oruro',mode='lines+markers') %>%
# add_trace(y=~pn$Recuperados,name='Pando',mode='lines+markers') %>%
# add_trace(y=~pt$Recuperados,name='PotosÃ',mode='lines+markers') %>%
# add_trace(y=~sc$Recuperados,name='Santa Cruz',mode='lines+markers') %>%
# add_trace(y=~tj$Recuperados,name='Tarija',mode='lines+markers') %>%
layout(
updatemenus=botones)
# list(
# list(
# y=700,
# buttons=list(
# list(method="restyle",
# args=list("visible",list(TRUE,FALSE)),
# label="Confirmados"),
# list(method="restyle",
# args=list("visible",list(FALSE,TRUE)),
# label="Decesos")
#)
#)
#)
#)
nuevos
## Warning: `arrange_()` is deprecated as of dplyr 0.7.0.
## Please use `arrange()` instead.
## See vignette('programming') for more help
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_warnings()` to see where this warning was generated.
#bn_nc=xts(x=bn[,3:5],order.by = bn$fecha)
#dygraph(bn_nc,xlab = "Fecha",ylab = "Número de casos",main="Beni") %>%
# dyRangeSelector() %>%
#dyOptions(drawGrid = FALSE,strokeWidth=2, colors=c("#E93504","#010332","#15CF0D")) %>%
#dyCrosshair(direction = "vertical")
l <- lapply(1:99, function(i) rnorm(100))
df <- as.data.frame(l)
cols <- paste0(letters, 1:99)
colnames(df) <- cols
df[["c"]] <- 1:100
## Add trace directly here, since plotly adds a blank trace otherwise
p <- plot_ly(df,
type = "scatter",
mode = "lines",
x = ~c,
y= ~df[[cols[[1]]]],
name = cols[[1]])
p <- p %>% add_lines(x = ~c, y = df[[2]], name = cols[[2]], visible = T)
p <- p %>% add_lines(x = ~c, y = df[[3]], name = cols[[3]], visible = T)
## Add arbitrary number of traces
## Ignore first col as it has already been added
for (col in cols[4:99]) {
print(col)
p <- p %>% add_lines(x = ~c, y = df[[col]], name = col, visible = F)
}
## [1] "d4"
## [1] "e5"
## [1] "f6"
## [1] "g7"
## [1] "h8"
## [1] "i9"
## [1] "j10"
## [1] "k11"
## [1] "l12"
## [1] "m13"
## [1] "n14"
## [1] "o15"
## [1] "p16"
## [1] "q17"
## [1] "r18"
## [1] "s19"
## [1] "t20"
## [1] "u21"
## [1] "v22"
## [1] "w23"
## [1] "x24"
## [1] "y25"
## [1] "z26"
## [1] "a27"
## [1] "b28"
## [1] "c29"
## [1] "d30"
## [1] "e31"
## [1] "f32"
## [1] "g33"
## [1] "h34"
## [1] "i35"
## [1] "j36"
## [1] "k37"
## [1] "l38"
## [1] "m39"
## [1] "n40"
## [1] "o41"
## [1] "p42"
## [1] "q43"
## [1] "r44"
## [1] "s45"
## [1] "t46"
## [1] "u47"
## [1] "v48"
## [1] "w49"
## [1] "x50"
## [1] "y51"
## [1] "z52"
## [1] "a53"
## [1] "b54"
## [1] "c55"
## [1] "d56"
## [1] "e57"
## [1] "f58"
## [1] "g59"
## [1] "h60"
## [1] "i61"
## [1] "j62"
## [1] "k63"
## [1] "l64"
## [1] "m65"
## [1] "n66"
## [1] "o67"
## [1] "p68"
## [1] "q69"
## [1] "r70"
## [1] "s71"
## [1] "t72"
## [1] "u73"
## [1] "v74"
## [1] "w75"
## [1] "x76"
## [1] "y77"
## [1] "z78"
## [1] "a79"
## [1] "b80"
## [1] "c81"
## [1] "d82"
## [1] "e83"
## [1] "f84"
## [1] "g85"
## [1] "h86"
## [1] "i87"
## [1] "j88"
## [1] "k89"
## [1] "l90"
## [1] "m91"
## [1] "n92"
## [1] "o93"
## [1] "p94"
## [1] "q95"
## [1] "r96"
## [1] "s97"
## [1] "t98"
## [1] "u99"
p <- p %>%
layout(
title = "Dropdown line plot",
xaxis = list(title = "x"),
yaxis = list(title = "y"),
updatemenus = list(
list(
y = 0.7,
## Add all buttons at once
buttons = lapply(0:32, function(col) {
list(method="restyle",
args = list("visible", cols == c(cols[col*3+1],cols[col*3+2],cols[col*3+3])),
label = paste0(cols[col*3+1], " ",cols[col*3+2], " ",cols[col*3+3] ))
})
)
)
)
p
acumulados=plot_ly(bn,type="scatter",
x=~Fecha,y=~Total_Confirmados,name="Beni",mode='lines+markers') %>%
add_trace(y=~cb$Total_Confirmados,name='Cochabamba',mode='lines+markers') %>%
add_trace(y=~ch$Total_Confirmados,name='Chuquisaca',mode='lines+markers') %>%
add_trace(y=~lp$Total_Confirmados,name='La Paz',mode='lines+markers') %>%
add_trace(y=~or$Total_Confirmados,name='Oruro',mode='lines+markers') %>%
add_trace(y=~pn$Total_Confirmados,name='Pando',mode='lines+markers') %>%
add_trace(y=~pt$Total_Confirmados,name='PotosÃ',mode='lines+markers') %>%
add_trace(y=~sc$Total_Confirmados,name='Santa Cruz',mode='lines+markers') %>%
add_trace(y=~tj$Total_Confirmados,name='Tarija',mode='lines+markers')